// 引入路由组件
import { Switch, Route } from "react-router-dom";
// 引入自己的组件
import NotFound from "../pages/NotFound.jsx";
import Index from "../pages/Index.jsx";
import Redux from "../pages/Redux.jsx";
import NewRedux from "../pages/NewRedux.jsx";
import Big from "../pages/Big.jsx";
import CountClass from "../pages/CountClass.jsx";
import CountFn from "../pages/CountFn.jsx";
import EffectClass from "../pages/EffectClass.jsx";
import EffectFn from "../pages/EffectFn.jsx";
import ReducerFn from "../pages/ReducerFn.jsx";
import Context from "../pages/Context.jsx";
import Login from "../pages/Login.jsx";
import LoginHook from "../pages/LoginHook.jsx";

import React, { Component } from 'react'

export default class Router extends Component {
  render() {
    return (
      <>
        <Switch>
          <Route exact path="/" component={Index}></Route>
          <Route path="/redux" component={Redux}></Route>
          <Route path="/newredux" component={NewRedux}></Route>
          <Route path="/big" component={Big}></Route>
          <Route path="/countclass" component={CountClass}></Route>
          <Route path="/countfn" component={CountFn}></Route>
          <Route path="/effectclass" component={EffectClass}></Route>
          <Route path="/effectfn" component={EffectFn}></Route>
          <Route path="/reducerfn" component={ReducerFn}></Route>
          <Route path="/context" component={Context}></Route>
          <Route path="/login" component={Login}></Route>
          <Route path="/loginhook" component={LoginHook}></Route>
          <Route path="*" component={NotFound}></Route>
        </Switch>
      </>
    )
  }
}
